<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
    <script src="js/axios.min.js"></script>
</head>
<body>

    <div id="app-25">
        <button type="button" @click="test">测试</button>
    </div>

    <script type="text/javascript">

        var vm = new Vue({
            el: "#app-25",
            data: {
            },
            methods: {
                test: function () {
                    // 发送异步请求
                    axios
                        .all([f1(), f2()])
                        .then(axios.spread(function (res1, res2) {
                            // 两个请求都要执行完毕
                            console.log("所有请求都完成")
                            console.log(res1);
                            console.log(res2);
                        }));
                }
            }
        });
        function f1() {
            console.log('调用第一个接口')
            return axios.get("json/json_demo.json");
        }
        function f2() {
            console.log('调用第二个接口')
            return axios.get("json/json_demo2.json");
        }
    </script>
</body>
</html>